package server;
// WebGameServer.java
// Server Thread waits for clients to connect and passes off the handling
// to an object of the class UpdateThread, which runs in a separate thread.

import java.net.*;
public class WebGameServer
{
	private static final int PORT = 4324;

	public static void main(String[] args)
	{
		new WebGameServer();
	}

	public WebGameServer()
	{
		UpdateThread updateThread = new UpdateThread();
		Thread t = new Thread(updateThread);
		t.start();
		try
		{
			ServerSocket server = new ServerSocket(PORT);
			while(true)
			{
				updateThread.addClient(server.accept());
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
	    }
	}
}